/* 书画摄影部分懒加载页面所使用的js
 * @author 王校兵
 * @date 2016-7-20
 * @version 1.0
 */

function paintingIndexScrollDownJs(scrollLength){
	if (scrollLength > 1400 && scrollLength < 2000
			&& !paint_index_floor_state[0]) {
		//创建右侧标题数组
		var rightTitle = [ [ "#", "书画摄影" ], [ "#", "篆刻雕塑" ],
				[ "#", "摄影摄像" ], [ "", "》" ] ];
		$.post("indexProduct", {
			page : "101",
			fromPosition : "1010401",
			toPosition : "1010419",
			newsToPosition : "1010409"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combineGoodsOne("新名家", rightTitle, product, "论坛/", data.news);
			$("#paint_index_mingjia").html(goods_html);

			//拼接广告区域
			var ad_html = combineTenArtist(product);
			$("#paint_index_mingjia_ad").html(ad_html);

		}, "json");

		paint_index_floor_state[0] = true;
	} else if (scrollLength > 2000 && scrollLength < 2600
			&& !paint_index_floor_state[1]) {
		//创建右侧标题数组  
		var rightTitle = [ [ "#", "书法绘画" ], [ "#", "书法绘画" ],
				[ "#", "摄影摄像" ], [ "", "》" ] ];
		$.post("indexProduct", {
			page : "101",
			fromPosition : "1010501",
			toPosition : "1010519",
			newsToPosition : "1010509"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combineGoodsOne("评论家", rightTitle,
					product, "论坛/", data.news);
			$("#paint_index_pinglun").html(goods_html);

			//拼接广告区域
			var ad_html = combineTenArtist(product);
			$("#paint_index_pinglun_ad").html(ad_html);

		}, "json");

		paint_index_floor_state[1] = true;
	} else if (scrollLength > 2600 && scrollLength < 3200
			&& !paint_index_floor_state[2]) {
		//创建右侧标题数组  
		var rightTitle = [ [ "#", "书法绘画" ], [ "#", "书法绘画" ],
				[ "#", "摄影摄像" ], [ "", ">>" ] ];
		$.post("indexProduct", {
			page : "101",
			fromPosition : "1010601",
			toPosition : "1010610",
			newsToPosition : "1010609"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combineGoodsOne("展销大厅", rightTitle,
					product, "论坛/", data.news);
			$("#paint_index_zhanxiao").html(goods_html);
			
			//拼接广告区域
			var ad_html = combineBottomAdTwo(product[9]);
			$("#paint_index_zhanxiao_ad").html(ad_html);

		}, "json");
		paint_index_floor_state[2] = true;
	} else if (scrollLength > 3200 && scrollLength < 3800
			&& !paint_index_floor_state[3]) {
		//创建右侧标题数组  
		var rightTitle = [ [ "#", "书法绘画" ], [ "#", "书法绘画" ],
				[ "#", "摄影摄像" ], [ "", ">>" ] ];
		$.post("indexProduct", {
			page : "101",
			fromPosition : "1010701",
			toPosition : "1010719",
			newsToPosition : "1010709"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combineGoodsOne("论坛活动", rightTitle,
					product, "论坛/", data.news);
			$("#paint_index_luntan").html(goods_html);

			//拼接广告区域
			var ad_html = combineTenArtist(product);
			$("#paint_index_luntan_ad").html(ad_html);

		}, "json");

		paint_index_floor_state[3] = true;
	} else if (scrollLength > 3800 && scrollLength < 4400
			&& !paint_index_floor_state[4]) {
		//创建右侧标题数组  
		var rightTitle = [ [ "#", "书法绘画" ], [ "#", "书法绘画" ],
				[ "#", "摄影摄像" ], [ "", ">>" ] ];
		$.post("indexProduct", {
			page : "101",
			fromPosition : "1010801",
			toPosition : "1010810",
			newsToPosition : "1010809"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combineGoodsOne("专题讲座", rightTitle,
					product, "论坛/", data.news);
			$("#paint_index_jiangzuo").html(goods_html);

			//拼接广告区域
			var ad_html = combineBottomAdTwo(product[9]);
			$("#paint_index_jiangzuo_ad").html(ad_html);

		}, "json");

		paint_index_floor_state[4] = true;
	} else if (scrollLength > 4400 && scrollLength < 5000
			&& !paint_index_floor_state[5]) {
		//创建右侧标题数组  
		var rightTitle = [ [ "#", "书法绘画" ], [ "#", "书法绘画" ],
				[ "#", "摄影摄像" ], [ "", ">>" ] ];
		$.post("indexProduct", {
			page : "101",
			fromPosition : "1010901",
			toPosition : "1010912",
			newsToPosition : "1010909"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combineGoodsOne("爱心诊所", rightTitle, product, "论坛/", data.news);
			$("#paint_index_zhensuo").html(goods_html);

			//拼接广告区域
			var ad_html = combineBottomAdOne(product[9],
					product[10], product[11]);
			$("#paint_index_zhensuo_ad").html(ad_html);

		}, "json");

		paint_index_floor_state[5] = true;
	} else if (scrollLength > 5000 && scrollLength < 5600
			&& !paint_index_floor_state[6]) {
		//创建右侧标题数组  
		var rightTitle = [ [ "#", "书法绘画" ], [ "#", "书法绘画" ],
				[ "#", "摄影摄像" ], [ "", ">>" ] ];
		$.post("indexProduct", {
			page : "101",
			fromPosition : "1011001",
			toPosition : "1011010",
			newsToPosition : "1011009"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combineGoodsOne("公益学院", rightTitle, product, "论坛/", data.news);
			$("#paint_index_gongyi").html(goods_html);

			//拼接广告区域
			var ad_html = combineBottomAdTwo(product[9]);
			$("#paint_index_gongyi_ad").html(ad_html);

		}, "json");

		paint_index_floor_state[6] = true;
	} else if (scrollLength > 5600 && scrollLength < 6200
			&& !paint_index_floor_state[7]) {
		//创建右侧标题数组  
		var rightTitle = [ [ "#", "书法绘画" ], [ "#", "书法绘画" ],
				[ "#", "摄影摄像" ], [ "", ">>" ] ];
		$.post("indexProduct", {
			page : "101",
			fromPosition : "1011101",
			toPosition : "1011119",
			newsToPosition : "1011109"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combineGoodsOne("私人订制", rightTitle, product, "论坛/", data.news);
			$("#paint_index_siren").html(goods_html);

			//拼接广告区域
			var ad_html = combineTenArtist(product);
			$("#paint_index_siren_ad").html(ad_html);

		}, "json");

		paint_index_floor_state[7] = true;
	} 
}